package com.etc.cure.controller;

import com.etc.common.utils.Result;
import com.etc.cure.entity.Outpatient;
import com.etc.cure.service.OutpatientService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/outpatient")
public class OutpatientController {

    @Resource
    private OutpatientService outpatientService;

    /**
     * 根据医生id查询门诊
     * @param docId
     * @return
     */
    @RequestMapping("/queryOutpatient")
    public Result queryOutpatient(String docId) {
        return outpatientService.queryOutpatient(docId);
    }

    /**
     * 根据门诊id查询门诊
     * @param outPatientId
     * @return
     */
    @RequestMapping("/queryOutpatientByOutpatientId")
    public Result queryOutpatientByOutpatientId(String outPatientId) {
        return outpatientService.queryOutpatientByOutpatientId(outPatientId);
    }

    /**
     * 新增门诊
     * @param outpatient
     * @return
     */
    @RequestMapping("/insertOutpatient")
    public Result insertOutpatient(@RequestBody Outpatient outpatient) {
        return outpatientService.insertOutpatient(outpatient);
    }

    /**
     * 根据门诊id修改门诊信息
     * @param outpatient
     * @return
     */
    @RequestMapping("/updateOutpatient")
    public Result updateOutpatient(@RequestBody Outpatient outpatient){
        return outpatientService.updateOutpatient(outpatient);
    }

}
